package service

import (
	"github.com/gin-gonic/gin"
	"groupchat/pkg"
	"net/http"
)

func Qi(c *gin.Context) {
	file, err := c.FormFile("image")
	if err != nil {
		return
	}
	qi, err := pkg.Qi(file)
	if err != nil {
		return
	}
	c.JSON(http.StatusOK, gin.H{
		"code": 200,
		"msg":  "图片上传成功",
		"data": gin.H{
			"url": qi,
		},
	})
	return
}
